package com.example.soa2.persistence;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.soa2.entity.UserProfile;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserProfileMapper extends BaseMapper<UserProfile> {
//    @Results({
//            @Result(property = "level_type", column = "type_id"),
//            @Result(property = "imgUrl", column = "course_img_url")
//    })
//    @Select("Select id, title, topic, duration, course_price, course_img_url, " +
//            "course_type.type_id FROM course LEFT JOIN course_type ON course.id = course_type.course_id WHERE type = #{i};")
//    List<SimpleCourse> getSimpleCourse(String i);

    @Update("Update user_profile SET state = 0 WHERE id = #{id};")
    int deleteUserProfile(String id);
}
